<template>
  <el-dropdown-menu size="default">
    <template v-for="(item, itemIndex) in data">
      <template v-if="item.children">
        <el-dropdown-item disabled divided class="el-dropdown-title">
          {{ typeof item.title === 'function' ? item.title(row) : item.title }}
        </el-dropdown-item>
        <ElDropdownMenuItemBox :data="child" :row="row" :index="index" v-for="(child, childIndex) in item.children" />
      </template>
      <template v-else>
        <ElDropdownMenuItemBox :divided="itemIndex > 0 && data[itemIndex - 1]?.children?.length > 0" :data="item"
          :row="row" :index="index" />
      </template>
    </template>
  </el-dropdown-menu>
</template>
<script setup lang="ts">
const { proxy } = getCurrentInstance() as any;
//获取父级数据
const props = withDefaults(
  defineProps<{
    data: any;
    row: any;
    index: number;
  }>(),
  {

  },
);


</script>
<style scoped></style>
